{include file="header.html"}
<script type="text/javascript">
//<!CDATA[
$(function(){
    $('#promotion_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
        success       : function(label){
            label.addClass('right').text('OK!');
        },
        rules : {
            goods_title : {
                required : true
            },
            goods_desc : {
                required : true
            },
            goods_img  : {
                accept : 'png|jpe?g|gif'
            }
        },
        messages : {
            goods_title : {
                required : '标题不能为空'
            },
            goods_desc  : {
                required : '描述不能为空'
            },
            goods_img  : {
                accept   : '图片的格式错误'
            }
        }
    });
});
//]]>
</script>
<div id="rightTop">
    <p>限时促销</p>
    <ul class="subnav">
        <li><a class="btn1" href="index.php?app=promotion">{$lang.manage}</a></li>
        <li><span>设置万菱闪购商品</span></li>
    </ul>
</div>

<div class="info">
    <form method="post" enctype="multipart/form-data" id="promotion_form">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">
                    标题:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput" id="goods_title" type="text" name="goods_title" value="{$promotion.goods_title|escape}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    描述:</th>
                <td class="paddingT15 wordSpacing5"> 
                <textarea name="goods_desc" style="width:300px;height:50px;">{$promotion.goods_desc|escape}</textarea>
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    参与人数:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableInput"  type="text" name="total_number" value="{$promotion.total_number}" />
                </td>
            </tr>
            <tr>
                <th class="paddingT15">
                    图片:</th>
                <td class="paddingT15 wordSpacing5">
                    <input class="infoTableFile" id="goods_img" type="file" name="goods_img" />
                </td>
            </tr>
            {if $promotion.goods_img}
            <tr>
                <th class="paddingT15">
                </th>
                <td class="paddingT15 wordSpacing5">
                <a href="{$promotion.goods_img}" target="_blank"><img src="{$promotion.goods_img}" class="makesmall" max_width="120" max_height="90" /></a>
                </td>
            </tr>
            {/if}

        <tr>
            <th></th>
            <td class="ptb20">
                <input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
                <input class="formbtn" type="reset" name="Submit2" value="{$lang.reset}" />
                <input class="formbtn" type="button" onclick="javascript:history.back();" value="返回">
            </td>
        </tr>
        </table>
    </form>
</div>
{include file="footer.html"}
